{include file="common/head"/}
<div class="admin-main fadeInUp animated"  ng-app="hd" ng-controller="ctrl">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>{$title}</legend>
    </fieldset>
    <form class="layui-form layui-form-pane">
       
        <input TYPE="hidden" name="id" value="{$info.id}">

        
        <div class="layui-form-item">
            <label class="layui-form-label">种类</label>
                <div class="layui-input-inline">

               
               <select name="type" lay-verify="required" >
                 {volist name="loan" id="vo" }
                     <option value="{$vo.id}" {if condition="$info.type eq $vo['id']"}selected{/if} >{$vo.typename}</option>
                  {/volist}
                </select>

            </div>
            <div class="layui-form-mid layui-word-aux red">*</div>
        </div>        
    


        <div class="layui-form-item">
            <label class="layui-form-label">保险名称</label>
                <div class="layui-input-inline">
                <input type="text" name="title" value="{$info['title']}" lay-verify="required" placeholder="{:lang('pleaseEnter')}保险名称" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux red">*</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">利率</label>
                <div class="layui-input-inline">
                <input type="text" name="rate" value="{$info['rate']}" lay-verify="required" placeholder="{:lang('pleaseEnter')}利率如：0.2" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux red">*（%）</div>
        </div>

       
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button>
                <a href="{:url('index')}" class="layui-btn layui-btn-primary">{:lang('back')}</a>
            </div>
        </div>
    </form>
</div>
{include file="common/foot"/}
<script src="__STATIC__/common/js/jquery.2.1.1.min.js"></script>
<script>
    layui.use(['form'], function () {
        var form = layui.form;

        form.on('submit(submit)', function (data) {
            var loading = layer.load(1, {shade: [0.1, '#fff']});
            $.post("{:url('edit')}", data.field, function (res) {
                layer.close(loading);
                if (res.code > 0) {
                    layer.msg(res.msg, {time: 1800, icon: 1}, function () {
                        location.href = res.url;
                    });
                } else {
                    layer.msg(res.msg, {time: 1800, icon: 2});
                }
            });
        });
    });
    
</script>

